@echo off

setlocal

set SRC=
set SRC=%SRC% src\dbapi\base.d
set SRC=%SRC% src\dbapi\helper.d
set SRC=%SRC% src\dbapi\sqlite3.d

set OBJ=out\dbapi.lib

set INC=..\sqlite\3.3.17\out\di

rem Would add "-H" to parms but dmd has a bug that does not output correct .di
rem files.
set PARMS=-lib -allobj -clean -full -unittest -debug -g -explicit

bud %SRC% -T%OBJ% -I%INC% %PARMS%

rem Copy the source files as .di files since dmd cannot generate correct .di
rem files yet.
rmdir out\di /S /Q
mkdir out\di\dbapi
copy src\dbapi\base.d      out\di\dbapi\base.di
copy src\dbapi\helper.d    out\di\dbapi\helper.di
copy src\dbapi\sqlite3.d   out\di\dbapi\sqlite3.di

endlocal
